/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#ifndef PLC4C_MQTT_READ_WRITE_MQT_T__PROPERTY_H_
#define PLC4C_MQTT_READ_WRITE_MQT_T__PROPERTY_H_

#include <stdbool.h>
#include <stdint.h>
#include <plc4c/driver_mqtt_static.h>
#include <plc4c/spi/read_buffer.h>
#include <plc4c/spi/write_buffer.h>
#include <plc4c/utils/list.h>
#include "mqt_t__string.h"
#include "mqt_t__property_type.h"
#include "mqt_t__property_type.h"

// Code generated by code-generation. DO NOT EDIT.

#ifdef __cplusplus
extern "C" {
#endif


// Structure used to contain the discriminator values for discriminated types using this as a parent
struct plc4c_mqtt_read_write_mqt_t__property_discriminator {
  enum plc4c_mqtt_read_write_mqt_t__property_type propertyType;
};
typedef struct plc4c_mqtt_read_write_mqt_t__property_discriminator plc4c_mqtt_read_write_mqt_t__property_discriminator;

// Enum assigning each sub-type an individual id.
enum plc4c_mqtt_read_write_mqt_t__property_type {
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__payloa_d__forma_t__indicator = 0,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__messag_e__expir_y__interval = 1,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__conten_t__type = 2,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__respons_e__topic = 3,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__correlatio_n__data = 4,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__subscriptio_n__identifier = 5,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__expir_y__interval = 6,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__assigne_d__clien_t__identifier = 7,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__serve_r__kee_p__alive = 8,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__authenticatio_n__method = 9,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__authenticatio_n__data = 10,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__reques_t__proble_m__information = 11,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__wil_l__dela_y__interval = 12,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__reques_t__respons_e__information = 13,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__respons_e__information = 14,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__serve_r__reference = 15,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__reaso_n__string = 16,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__receiv_e__maximum = 17,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__topi_c__alia_s__maximum = 18,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__topi_c__alias = 19,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__maximu_m__qos = 20,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__retai_n__available = 21,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__use_r__property = 22,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__maximu_m__packe_t__size = 23,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__wildcar_d__subscriptio_n__available = 24,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__subscriptio_n__identifie_r__available = 25,
  plc4c_mqtt_read_write_mqt_t__property_type_plc4c_mqtt_read_write_mqt_t__property__share_d__subscriptio_n__available = 26};
typedef enum plc4c_mqtt_read_write_mqt_t__property_type plc4c_mqtt_read_write_mqt_t__property_type;

// Function to get the discriminator values for a given type.
plc4c_mqtt_read_write_mqt_t__property_discriminator plc4c_mqtt_read_write_mqt_t__property_get_discriminator(plc4c_mqtt_read_write_mqt_t__property_type type);

struct plc4c_mqtt_read_write_mqt_t__property {
  /* This is an abstract type so this property saves the type of this typed union */
  plc4c_mqtt_read_write_mqt_t__property_type _type;
  /* Properties */
  plc4c_mqtt_read_write_mqt_t__property_type property_type;
  union {
    struct { /* MQTT_Property_PAYLOAD_FORMAT_INDICATOR */
      uint8_t mqt_t__property__payloa_d__forma_t__indicator_value;
    };
    struct { /* MQTT_Property_MESSAGE_EXPIRY_INTERVAL */
      uint32_t mqt_t__property__messag_e__expir_y__interval_value;
    };
    struct { /* MQTT_Property_CONTENT_TYPE */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__conten_t__type_value;
    };
    struct { /* MQTT_Property_RESPONSE_TOPIC */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__respons_e__topic_value;
    };
    struct { /* MQTT_Property_SUBSCRIPTION_IDENTIFIER */
      uint32_t mqt_t__property__subscriptio_n__identifier_value;
    };
    struct { /* MQTT_Property_EXPIRY_INTERVAL */
      uint32_t mqt_t__property__expir_y__interval_value;
    };
    struct { /* MQTT_Property_ASSIGNED_CLIENT_IDENTIFIER */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__assigne_d__clien_t__identifier_value;
    };
    struct { /* MQTT_Property_SERVER_KEEP_ALIVE */
      uint16_t mqt_t__property__serve_r__kee_p__alive_value;
    };
    struct { /* MQTT_Property_AUTHENTICATION_METHOD */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__authenticatio_n__method_value;
    };
    struct { /* MQTT_Property_REQUEST_PROBLEM_INFORMATION */
      uint8_t mqt_t__property__reques_t__proble_m__information_value;
    };
    struct { /* MQTT_Property_WILL_DELAY_INTERVAL */
      uint32_t mqt_t__property__wil_l__dela_y__interval_value;
    };
    struct { /* MQTT_Property_REQUEST_RESPONSE_INFORMATION */
      uint8_t mqt_t__property__reques_t__respons_e__information_value;
    };
    struct { /* MQTT_Property_RESPONSE_INFORMATION */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__respons_e__information_value;
    };
    struct { /* MQTT_Property_SERVER_REFERENCE */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__serve_r__reference_value;
    };
    struct { /* MQTT_Property_REASON_STRING */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__reaso_n__string_value;
    };
    struct { /* MQTT_Property_RECEIVE_MAXIMUM */
      uint16_t mqt_t__property__receiv_e__maximum_value;
    };
    struct { /* MQTT_Property_TOPIC_ALIAS_MAXIMUM */
      uint16_t mqt_t__property__topi_c__alia_s__maximum_value;
    };
    struct { /* MQTT_Property_TOPIC_ALIAS */
      uint16_t mqt_t__property__topi_c__alias_value;
    };
    struct { /* MQTT_Property_MAXIMUM_QOS */
      uint8_t mqt_t__property__maximu_m__qos_value;
    };
    struct { /* MQTT_Property_RETAIN_AVAILABLE */
      uint8_t mqt_t__property__retai_n__available_value;
    };
    struct { /* MQTT_Property_USER_PROPERTY */
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__use_r__property_name;
      plc4c_mqtt_read_write_mqt_t__string* mqt_t__property__use_r__property_value;
    };
    struct { /* MQTT_Property_MAXIMUM_PACKET_SIZE */
      uint32_t mqt_t__property__maximu_m__packe_t__size_value;
    };
    struct { /* MQTT_Property_WILDCARD_SUBSCRIPTION_AVAILABLE */
      uint8_t mqt_t__property__wildcar_d__subscriptio_n__available_value;
    };
    struct { /* MQTT_Property_SUBSCRIPTION_IDENTIFIER_AVAILABLE */
      uint8_t mqt_t__property__subscriptio_n__identifie_r__available_value;
    };
    struct { /* MQTT_Property_SHARED_SUBSCRIPTION_AVAILABLE */
      uint8_t mqt_t__property__share_d__subscriptio_n__available_value;
    };
  };
};
typedef struct plc4c_mqtt_read_write_mqt_t__property plc4c_mqtt_read_write_mqt_t__property;

// Create an empty NULL-struct
plc4c_mqtt_read_write_mqt_t__property plc4c_mqtt_read_write_mqt_t__property_null();

plc4c_return_code plc4c_mqtt_read_write_mqt_t__property_parse(plc4c_spi_read_buffer* readBuffer, plc4c_mqtt_read_write_mqt_t__property** message);

plc4c_return_code plc4c_mqtt_read_write_mqt_t__property_serialize(plc4c_spi_write_buffer* writeBuffer, plc4c_mqtt_read_write_mqt_t__property* message);

uint16_t plc4c_mqtt_read_write_mqt_t__property_length_in_bytes(plc4c_mqtt_read_write_mqt_t__property* message);

uint16_t plc4c_mqtt_read_write_mqt_t__property_length_in_bits(plc4c_mqtt_read_write_mqt_t__property* message);

#ifdef __cplusplus
}
#endif
#endif  // PLC4C_MQTT_READ_WRITE_MQT_T__PROPERTY_H_
